package org.zxp.designpattern.agent;

import org.zxp.designpattern.agent.dy.UserDaoDynaProxy;
import org.zxp.designpattern.agent.st.UserDaoProxy;

/**
 * @program: effectiveJava
 * @description:
 * @author: X-Pacific zhang
 * @create: 2019-08-27 15:58
 **/
public class Test {
    @org.junit.Test
    public void testSt(){
        UserDaoProxy proxy = new UserDaoProxy();
        proxy.insert("zxp");
    }


    @org.junit.Test
    public void testDy(){
        UserDaoIntf proxy = new UserDaoDynaProxy<UserDaoIntf>().getProxy(new UserDaoImpl());
        proxy.insert("zxp");    
        System.out.println(proxy.getClass().getName());//com.sun.proxy.$Proxy4
    }
}
